package ds_recommended.self_chuli

import org.apache.spark.sql.SparkSession

import java.util.Properties

object chakan_recommend {
  def main(args: Array[String]): Unit = {
    //  准备spark的环境
    val spark = SparkSession.builder()
      .master("local[*]")
      .appName("基于协同过滤的推荐")
      .getOrCreate()




    //  连接mysql的配置
    val connect = new Properties()
    connect.setProperty("user", "root")
    connect.setProperty("password", "123456")
    connect.setProperty("driver", "com.mysql.jdbc.Driver")

    spark.read.jdbc("jdbc:mysql://192.168.67.193:3307/dws?useSSL=false","offline_recommend",connect)
      .show(false)



    spark.close()
  }

}
